/*    */ package eos.moe.dragoncore;
/*    */ 
/*    */ import java.io.File;
/*    */ import java.io.FileNotFoundException;
/*    */ import java.io.IOException;
/*    */ import java.io.InputStream;
/*    */ import java.io.RandomAccessFile;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public abstract class ph
/*    */   extends InputStream
/*    */ {
/*    */   public RandomAccessFile z;
/*    */   public File i;
/*    */   private boolean w;
/* 18 */   private int q = 0;
/* 19 */   private byte[] g = new byte[1];
/*    */   
/*    */   public ph(File file, boolean bool, int i) throws FileNotFoundException {
/* 22 */     this.z = new RandomAccessFile(file, dg.i.v());
/* 23 */     this.i = file;
/* 24 */     this.w = bool;
/*    */ 
/*    */     
/* 27 */     if (bool) {
/* 28 */       this.q = i;
/*    */     }
/*    */   }
/*    */ 
/*    */   
/*    */   public int read() throws IOException {
/* 34 */     int i = read(this.g);
/* 35 */     if (i == -1) {
/* 36 */       return -1;
/*    */     }
/*    */     
/* 39 */     return this.g[0];
/*    */   }
/*    */ 
/*    */   
/*    */   public int read(byte[] arrayOfByte) throws IOException {
/* 44 */     return read(arrayOfByte, 0, arrayOfByte.length);
/*    */   }
/*    */ 
/*    */   
/*    */   public int read(byte[] arrayOfByte, int i, int j) throws IOException {
/* 49 */     int k = this.z.read(arrayOfByte, i, j);
/*    */     
/* 51 */     if ((k != j || k == -1) && this.w) {
/* 52 */       v(this.q + 1);
/* 53 */       this.q++;
/*    */       
/* 55 */       if (k < 0) k = 0; 
/* 56 */       int m = this.z.read(arrayOfByte, k, j - k);
/* 57 */       if (m > 0) k += m;
/*    */     
/*    */     } 
/* 60 */     return k;
/*    */   }
/*    */ 
/*    */   
/*    */   public void v(dj dj1) throws IOException {
/* 65 */     if (this.w && this.q != dj1.t()) {
/* 66 */       v(dj1.t());
/* 67 */       this.q = dj1.t();
/*    */     } 
/*    */     
/* 70 */     this.z.seek(dj1.s());
/*    */   }
/*    */   
/*    */   public void v(int i) throws IOException {
/* 74 */     File file = v(i);
/* 75 */     if (!file.exists()) {
/* 76 */       throw new FileNotFoundException("zip split file does not exist: " + file);
/*    */     }
/* 78 */     this.z.close();
/* 79 */     this.z = new RandomAccessFile(file, dg.i.v());
/*    */   }
/*    */ 
/*    */   
/*    */   public abstract File v(int paramInt) throws IOException;
/*    */   
/*    */   public void close() throws IOException {
/* 86 */     if (this.z != null)
/* 87 */       this.z.close(); 
/*    */   }
/*    */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\ph.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */